package com.heima.admin.controller.v1;

import com.heima.admin.service.AdUserService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

@Api(value = "AI实名认证API",tags = "AI实名认证API")
@RestController
@RequestMapping("/api/v1/management")
public class RealNameManagementController {
    @Autowired
    AdUserService adUserService;

    @ApiOperation("上传并AI认证")
    @PostMapping("/realname")
    public ResponseResult RealNameManagement(@RequestBody AuthDTO dto,MultipartFile fontImage,MultipartFile backImage,MultipartFile liveImage){
        Map<Integer,MultipartFile> map = new HashMap<>();
        map.put(0,fontImage);
        map.put(1,backImage);
        map.put(9,liveImage);

        return adUserService.AIupdateStatusById(dto,map);
    }
}
